package com.cloud.adrian.novel.search.service;

import com.cloud.adrian.novel.book.dto.req.BookSearchReqDto;
import com.cloud.adrian.novel.book.dto.resp.BookInfoRespDto;
import com.cloud.adrian.novel.common.resp.PageRespDto;
import com.cloud.adrian.novel.common.resp.RestResp;

import java.io.IOException;

/**
 * 搜索服务类
 * @Author: xiangguiliang
 * @version: 1.0
 * @since: 2024/05/26
 */
public interface SearchService {

    /**
     * 小说搜索
     * @param condition 搜索条件
     * @return 搜索结果
     */
    RestResp<PageRespDto<BookInfoRespDto>> searchBooks(BookSearchReqDto condition);

    /**
     * 新增索引库小说
     * @param bookId 小说ID
     * @throws IOException 异常
     */
    void insertNovel(Long bookId) throws IOException;

    /**
     * 更新索引库小说
     * @param bookId 小说ID
     * @throws IOException 异常
     */
    void updateNovel(Long bookId) throws IOException;

    /**
     * 删除索引库小说
     * @param bookId 小说ID
     */
    void deleteNovel(Long bookId) throws IOException;
}
